package com.structure.bridging.channel;

import com.structure.bridging.mode.IPayMode;
import lombok.extern.slf4j.Slf4j;

import java.math.BigDecimal;

/**
 * @author xiaobing
 * @version 1.0
 * @date 2021/9/8 6:43 下午
 */
@Slf4j
public class WxPay extends Pay {
    public WxPay(IPayMode iPayMode) {
        super(iPayMode);
    }

    @Override
    public String transfer(String uid, String traceId, BigDecimal amount) {
        log.info("模拟微信渠道支付划账开始，uid={},traceId={},amount={}", uid, traceId, amount);
        Boolean security = iPayMode.security(uid);
        log.info("模拟微信支付风控风险，security={}", security);
        if (Boolean.FALSE.equals(security)) {
            log.info("拦截微信支付");
        } else {
            log.info("没有拦截微信支付");
        }
        return "0000";
    }
}
